<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta content="招聘" http-equiv="keywords">
    <meta name="description" content="招聘,培训">
    <meta name="format-detection" content="telephone=no"><!-- 禁止IPHONE识别手机号码 -->
    <meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1">
    <meta name="renderer" content="webkit">

    <title>添加联系人</title>
    <!-- css -->
    <link rel="stylesheet" type="text/css" th:href="@{/asserts/css/index.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/asserts/css/swiper.min.css}">
    <!-- public_css -->
    <link rel="stylesheet" type="text/css" th:href="@{/asserts/css/public_lib.css}">
    <!-- zy_public_css -->
    <link rel="stylesheet" type="text/css" th:href="@{/asserts/css/zy_public.css}">
    <!-- 子页css -->
    <link rel="stylesheet" type="text/css" th:href="@{/asserts/css/children.css}">
    <!-- js -->
    <script type="text/javascript" th:src="@{/asserts/js/jquery-3.3.1.min.js}"></script>
    <script type="text/javascript" th:src="@{/asserts/js/swiper.min.js}"></script>
    <script type="text/javascript" th:src="@{/asserts/js/public.js}"></script>
    <script th:src="@{/asserts/Apolar_sh/lib/layer/2.4/layer.js}"></script>

</head>
<body>
<header class="zy_search_top_box scroll_fix">
    <div class="zy_title_top fix">
        <div class="one" href="javascript:" onclick="history.back();"><img th:src="@{/asserts/images/back_jt.png}">
            <a style="color: #FFFFFF;"><span>返回</span></a>
        </div>
        <h1>添加联系人</h1>

    </div>
</header>

<!-- 内容框 -->
<div class="zy_module-content zy_vip_conbox">
    <div class="zy_vip_scbox zy_vip_myfabu bgwh">

        <div class="sc_list vip_user_info_mima vip_user_createbox">
            <!-- 发布职位招聘 -->
            <div class="reason">添加联系人</div>
            <!--<form method="post" th:action="@{/mCampusConn/save(RcurrentPage=${RcurrentPage},RpageSize=${RpageSize})}">-->

            <form id="addForm">
                <input type="text" hidden name="campusId" id="campusId" th:value="${campusId}">
                <div class="write">
                    <div class="form_line">
                        <label><span>院校名称</span><input type="text" th:value="${campusName}" readonly></label>
                    </div>
                    <div class="form_line">
                        <label><span>姓名</span><input type="text" id="name" required name="campusConnName"
                                                     value=""></label>
                    </div>
                    <div class="form_line bbd xzbox work_style">
                        <span>职务</span>
                        <select name="campusConnPosition">
                            <option selected>---请选职务---</option>
                            <option>院长</option>
                            <option>副院长</option>
                            <option>书记</option>
                            <option>主任</option>
                            <option>老师</option>
                            <option>其他</option>
                        </select>
                    </div>
                    <div class="form_line bbd xzbox work_style">
                        <span>性别</span>
                        <select name="campusConnSex">
                            <option>男</option>
                            <option>女</option>
                        </select>
                    </div>
                    <div class="form_line bbd xzbox work_style">
                        <span>渠道专员</span>
                        <select name="marketEmployeeId">
                            <option selected th:value="${session.user.uid}"
                                    th:text="${session.user.personname}"></option>
                        </select>
                    </div>
                    <div class="form_line">
                        <label><span>联系方式</span><input type="tel" id="phone" name="campusConnWay" value=""
                                                       required></label>
                    </div>
                    <div class="form_line">
                        <label><span>个人情况</span><textarea name="campusConnPersonal"></textarea></label>
                    </div>
                    <div class="form_line">
                        <label><span>备注</span><textarea name="campusConnRemarks"></textarea></label>
                    </div>
                    <a th:onclick="submit([[${RcurrentPage}]],[[${RpageSize}]])">
                        <div class="zy_butn bord_3"> 保存</div>
                    </a>
                    <!--<button class="zy_butn bord_3" th:onclick="submit([[${RcurrentPage}]],[[${RpageSize}]])">保存</button>-->
                </div>
            </form>
        </div>

    </div>

</div>
<!-- 底部导航 -->
<div class="foot_menu">
    <ul>
        <li><a style="color: #00caff" th:href="@{/mcampus/findAll}"> <i><img
                th:src="@{/asserts/images/menu_icon01.png}"></i> <span>信息采集</span> </a>
        </li>
        <li><a th:href="@{/mcampusVisit/findAll}"> <i><img
                th:src="@{/asserts/images/menu_icon02.png}"></i>
            <span>拜访记录</span> </a></li>
        <li><a th:href="@{/mTraining/list}"> <i><img
                th:src="@{/asserts/images/menu_icon03.png}"></i>
            <span>实训订单</span></a></li>
        <li><a th:href="@{/mds/dsShow}"> <i><img
                th:src="@{/asserts/images/menu_icon04.png}"></i>
            <span>日常经费</span> </a></li>
    </ul>
</div>
</body>
<script>
    function submit(RcurrentPage, RpageSize) {
        var name = $("#name").val();
        var phone = $("#phone").val();
        var campusId = $("#campusId").val();
        if (name == null || name === "") {
            layer.msg('亲，姓名不能为空哦!', {
                icon: 0,
                time: 1000
            });
        } else if (phone == null || phone === "") {
            layer.msg('亲，联系方式不能为空哦!', {
                icon: 0,
                time: 1500
            });
        } else {
            $.ajax({
                type: 'POST',
                url: './save?RcurrentPage=' + RcurrentPage + '&RpageSize=' + RpageSize,
                data: $("#addForm").serialize(),
                success: function (data) {
                    if (data == '1') {
                        layer.msg('添加成功！', {icon: 1, time: 500});
                        setTimeout(function () {
                            location.replace('[[${#httpServletRequest.getContextPath()}]]' + '/mCampusConn/findAll?campusId='+campusId+'&RcurrentPage=' + RcurrentPage + '&RpageSize=' + RpageSize );
                        }, 500);
                    } else {
                        layer.msg('添加失败', {icon: 0, time: 2000});
                    }
                },
                error: function (data) {
                    console.log(data.msg);
                }
            })
        }
    }
</script>
</html>
